#include<stdio.h>
#include<unistd.h>
int main()
{
    printf("进程：%d 父进程：%d\n",getpid(),getppid());
    pid_t pid=fork();

    if(pid==0)
    {
        printf("pid==0\n子进程：%d,父进程：%d\n",getpid(),getppid()); 
        printf("pid=%d\n",pid);
    }
    else if(pid>0)
    {
        printf("pid>0\n子进程：%d,父进程：%d\n",getpid(),getppid());
        printf("pid=%d\n",pid);
    }
    return 0;
}
